package com.mib.browser;

import javax.swing.*;
import javax.swing.table.TableCellRenderer;
import java.awt.*;

public class OperationTableRenderer extends JLabel implements TableCellRenderer {
    public OperationTableRenderer() {
        this.setOpaque(true);
    }

    public Component getTableCellRendererComponent(JTable table, Object color, boolean isSelected, boolean hasFocus, int row, int column) {
        if (row % 2 == 1) {
            this.setBackground(new Color(246, 248, 246));
        } else {
            this.setBackground(Color.WHITE);
        }

        if (table.getValueAt(row, column) != null) {
            this.setText("  " + table.getValueAt(row, column).toString());
        }

        return this;
    }
}
